-
Notifications
You must be signed in to change notification settings - Fork 25
Introducing take
Method
#146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing take
Method
#146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for a PR! I'm not sure how often this get + flush combination is actually needed in practice, but if it is a common enough pattern to warrant its own method, then I think the implementation makes sense.
However, I have concerns about the pull()
method name - it's quite ambiguous and doesn't clearly communicate what's happening.
What about alternatives like:
take()
- this name suggests "taking" the value away from its source, implying both retrieval and removalpop()
- in array/stack terminology,pop()
removes and returns the last element
As I have no disagreement regarding the name, I updated the PR adapting it to |
Please make sure to sign ALL your commits with GPG. |
One more thing - may I ask what is your use case for this method? |
Description
Hey, folks! After a long period, I'd like to get back to contributing to CodeIgniter 'cause this was my first framework during my career. This PR aims to introduce the
take
method, which can be used to perform two operations in a single interaction:get
+flush
, improving the dev experience in favor to avoid the need to manually perform these two operations individuallyDemonstration
Checklist: